Turbochip 0.4 - Junosix 26.12.18


SND	samples folder (contains signed 8-bit samples)
TC	songs folder
TC.PRG	the editor/player


--- Operations mode

F1	Waveform editor
	F5 and F6		Select waveform
	F7 and F8		Coarse edit waveform sample
	F9			Stop waveform preview
	F10			Waveform preview (uses note "G", press to move through octaves)
	Cursor down and up	Fine edit waveform
	Cursor left and right	Select sample byte

F2	Sample loader
	F5 and F6		Select sample slot
	F10			Sample preview
	Cursor up		Load sample (press Return then enter sample name)
	Cursor down		Erase sample (press Return)

F3	Disk operations
	Cursor up		Load song (press Return then enter song name)
	Cursor down		Save song (press Return then enter song name)

F4	System operations
	Cursor up		Erase patterns (press Return)
	Cursor down		Quit (press Return)

Esc	Enter Editor mode


--- Editor mode

Cursor up	Move edit cursor up
Cursor down	Move edit cursor down
Cursor left	Move edit cursor left
Cursor right	Move edit cursor right

Space	Toggle key preview

F1	Places edit cursor at top of pattern
F2	Places edit cursor at bottom of pattern
F3	Quick move cursor left
F4	Quick move cursor right
F5	Octave down
F6	Octave up
F7	Move to previous pattern in pattern list
F8	Move to next pattern in pattern list

;	Copy selected pattern to current pattern
/	Pattern list page down
'	Pattern list page up
Insert	Set pattern loop
#	Clear pattern loop			( this is the \ key on Hatari...)

( (pad)	Set top copy/cut marker			( this is the [ key on Hatari... )
) (pad)	Set bottom copy/cut marker		( this is the ] key on Hatari... )

,	Transpose selected pattern down
.	Transpose selected pattern up

F9	Pattern note/effect/volume or sample number (dependent on channel selected) paste and cut
F10	Pattern Pattern note/effect/volume or sample number (dependent on channel selected) paste without cut

Return	Play song from current pattern
	When playing, short press stops song, long press repeats current pattern

Home	Move to pattern list position zero, unmute all channels, reset edit and play cursors

Esc	Enter Operations mode


--- Playback mode

F1 to F7 mutes/unmutes channels 1 to 7

Return	Stop song


--- Description of display (based on view of fresh pattern data)

4 1--EVTND  2--EVTND  3--EVTND  4--EVWD  5--EVWD  6--EVWD  7  NP  D  A-12  S  00
1 ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
2 ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
3 ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
4 ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
5 ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
6 ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
7 ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
8 ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00
  ---00000  ---00000  ---00000  ---0000  ---0000  ---0000  0  00  0  0 00  6  00

"4" in top left		= current octave
"1--" etc		= channel number
E			= effect number (0-f - see table)
V			= volume (0-f)
T			= tone enable (YM channels (1 to 3) only) 
N			= noise enable (YM channels (1 to 3) only)
D			= detune enable
W			= waveform select (DMA channels (4 to 6) only)
			(waveforms 8 and 9 are treated as wave-step effect)

7			= PCM channel, enter sample numbers below here

NP			= noise generator frequency

D			= global detune value (0 to 3)

A			= channel select for arpeggiator
1			= number of semitones above base note for arp 1
2			= number of semitones above base note for arp 2

S			= number of 50Hz frames until next tempo change (0 to skip to next pattern)

00			= pattern list column (current pattern is displayed at top)


--- Effects

volume-based effects
0 - no effect
1 - staccato
2 - attack fast
3 - attack slow
4 - decay fast
5 - decay slow
6 - tremolo fast
7 - tremolo slow

pitch-based effects
8 - pitch up fast
9 - pitch up slow
a - pitch down fast
b - pitch down slow
c - vibrato fast
d - vibrato slow
e - octave blip
f - octave blip with decay


--- Technical details (more to come)

Turbochip file format:

offset	0	8 bytes:
		$54,$52,$42,$43,$48,$50,$xx,$xx (TRBCHPxx) (longword header, version number as ASCII string)

offset	8	512 bytes:
		32-byte waveform data x 16

offset	520	32 bytes:
		2-byte sample length list x 16

offset	552	length is total sum of words between offsets 520-550:
		pcm sample data

offset	xx	1 byte:
		song loop position

offset	xx	1 byte:
		song length

offset	xx	640 x song length:
		pattern line length is 20 bytes
		each pattern consists of 32 pattern lines
		so each pattern consists of 20 x 32 (640) bytes

		each pattern line is:

		byte	00	volume/effect	(channel 1)
		byte	01	note		(channel 1)
		byte	02	volume/effect	(channel 2)
		byte	03	note		(channel 2)
		byte	04	volume/effect	(channel 3)
		byte	05	note		(channel 3)
		byte	06	volume/effect	(channel 4)
		byte	07	note		(channel 4)
		byte	08	volume/effect	(channel 5)
		byte	09	note		(channel 5)
		byte	10	volume/effect	(channel 6)
		byte	11	note		(channel 6)
		byte	12	noise/tone enable
		byte	13	noise/tone control
		byte	14	pcm and a waves index		(most-significant nibble = pcm, least-significant = a)
		byte	15	b and c waves index		(most-significant nibble = b, least-significant = c) 
		byte	16	detunes		(bit 0 = chan 1, 1 = chan 2, 2 = chan 3, 3 = chan 4, 4 = chan 5, 5 = chan 6)
		byte	17	arp 1 base note incrementer
		byte	18	arp 2 base note incrementer
		byte	19	arp pair and tempo


--- Things to try

There are a few demo songs in the TC folder, they are "TCDEMO", "TC303", "COOL", "RAVE", "FRANKIE", "SWEET" and a partially-finished cover of the Robocop tune.  Try loading them in Operations mode and having a look at them in Editor mode to get the jist of how things work.

There is a Roland TR-909 sample set in the SND folder.  Make a note of these file names and try to load them in using the Sample loader function.

You can quick-erase selected pattern data by setting the start marker with "(" and moving to the end and setting the end marker with ")", then moving back to the start position and pressing F9.


--- To do

Samples can't be larger than about 32KB at the moment
Crashes on 4MB machines
Reported memory inaccurate (do away with this anyway?)
Check what is reset on song load/pattern erase
Hit Esc on load song/load sample to quit

8 is dma wave-stepper fast
9 is dma wave-stepper slow
